package rpc

import (
	"github.com/gin-gonic/gin"
	"grpc/common/pb/user"
	common "grpc/common/res"
)

func UserRegister(ctx *gin.Context) {
	var userReq user.UserRegisterReq
	if err := ctx.Bind(&userReq); err != nil {
		common.Res(nil, err, ctx)
		return
	}
	res, err := UserClient.UserRegister(ctx, &userReq)
	if err != nil {
		common.Res(res, err, ctx)
		return
	}
	common.Res(res, nil, ctx)
}
